package com.smartcommunity.entity.video;

import com.smartcommunity.utils.DateUtils;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.text.ParseException;

@Data
@Slf4j
public class BaseVideoFile {
    public static final String FORMAT = "yyyyMMddHHmmssSSS";
    public long begin;
    public long end;
    public short vodType;
    public String file;
    /**
     * 存储设备Id
     */
    public String storage;

    public void setBeginTime(String beginTime) {
        try {
            begin = DateUtils.parseDate(beginTime, FORMAT);
        } catch (ParseException e) {
            log.error("BaseVideoFile:setBeginTime error,e", e);
        }
    }

    public void setEndTime(String endTime) {
        try {
            end = DateUtils.parseDate(endTime, FORMAT);
        } catch (ParseException e) {
            log.error("BaseVideoFile:setEndTime error,e", e);
        }
    }
}
